import http from "@/utils/http";

const ctfContestApi = {
  // 获取靶场列表
  getRangeList: () => {
    return http.get("/range/list2");
  },

  // 添加考试-靶场关联
  addContestRangeRel: (data: any) => {
    return http.post("/relcontestrange/add", data);
  },

  // 获取用户列表
  getUserList: () => {
    return http.get("/alluser/list");
  },

  // 添加用户-考试关联
  addUserContestRel: (data: any) => {
    return http.post("/relusercontest/add", data);
  },

  // 获取考试列表
  getContestList: () => {
    return http.get("/ctfcontest/list");
  },

  // 添加考试
  addContest: (data: any) => {
    return http.post("/ctfcontest/add", data);
  },

  // 更新考试
  updateContest: (data: any) => {
    return http.post("/ctfcontest/update", data);
  },

  // 删除考试
  deleteContest: (contestId: number) => {
    return http.delete(`/ctfcontest/delete/${contestId}`);
  },
  //多条件查询
  queryContest: (contest: object) => {
    return http.post(`/ctfcontest/query`,contest);
  },
  //删除考试
  deleteContestById: (contest: Object) => {
    return http.post(`/ctfcontest/delete`,contest)
  },
  //批量删除
  deleteContestBatch: (contestIds: number[]) => {
    return http.post("/ctfcontest/delete/batch", { contestIds });
  },


};

export default ctfContestApi;